package com.open.rbac.model.dto.sys;

import java.time.LocalDate;
import java.util.List;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;

import com.open.center.common.databind.annotation.EmailDesensitize;
import com.open.center.common.databind.annotation.PhoneDesensitize;
import com.open.center.model.dto.BaseDto;
import com.open.rbac.constant.GenderType;

/**
 * 用户传输对象
 *
 * @author Riche's
 * @since 2022/8/12
 */
@Schema(name = "UserDto", description = "用户")
@EqualsAndHashCode(callSuper = true)
@Setter
@Getter
public class UserDto extends BaseDto {

    @Schema(description = "用户ID")
    private String id;

    @Schema(description = "用户名称")
    private String username;

    @Schema(description = "姓名/昵称")
    private String realname;

    @Schema(description = "性别")
    private GenderType gender;

    @Schema(description = "生日")
    private LocalDate birthday;

    @Schema(description = "邮箱")
    private String email;

    @Schema(description = "手机")
    private String phone;

    @Schema(description = "邮箱显示")
    @EmailDesensitize
    private String showEmail;

    @Schema(description = "手机显示")
    @PhoneDesensitize
    private String showPhone;

    @Schema(description = "头像")
    private String avatar;

    @Schema(description = "是否启用")
    private boolean enable;

    @Schema(description = "备注")
    private String remark;


    @Schema(description = "角色列表文本")
    private String roleText;

    @Schema(description = "组织机构列表文本")
    private String organizationText;

    @Schema(description = "用户角色列表")
    private List<RoleDto> roles;

    @Schema(description = "组织机构列表")
    private List<OrganizationDto> organizations;

}
